package 矩阵.反转图像;

/**
 * TODO
 *
 * @className: fztx
 * @description: TODO
 * @author: 等什么柠檬君
 * @date: 2022-05-01 13:37
 **/
public class fztx {
    public static void main(String[] args) {
        int arr[][] = {{1,1,0},{1,0,1},{0,0,0}};
        flipAndInvertImage(arr);
    }
    public static int[][] flipAndInvertImage(int[][] image) {
        for (int i = 0; i < image.length; i++) {
            int[] item = new int[image[i].length];
            for (int i1 = image[i].length-1; i1 >=0 ; i1--) {
                item[image[i].length-1-i1] = image[i][i1]==0?1:0;
            }
            image[i] = item;
        }
        return image;
    }
}
